<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


/**
 * Smarty relimage modifier plugin
 *
 * Type:     modifier<br>
 * Name:     relimage<br>
 * Date:     oct 20, 2010
 * Purpose:  get the input image to thumbnail 
 * Input:    image src 
 * Example:  {$image|relimage:"100X100"}
 * @author   qian.liu01 <qian.liu01@jrj.com.cn>
 * @version 1.0
 * @param string
 * @param string
 * @return string
 */
function smarty_modifier_relimage($image, $thumb)
{
    if($image && $thumb) {
    	$img   = explode('.',$image);
    	$thumb = strtolower($thumb);
    	$thumbnail = $img[0].'_'.$thumb.'.'.$img[1];
    } else {
    	$thumbnail = $image;
    }
    
    return $thumbnail;
}

/* vim: set expandtab: */

?>
